<template>
  <div class="search">
    <el-row :gutter="14" type="flex" justify="start">
      <el-col :span="20">
        <el-input v-model="search" style="width:200px;" placeholder="请输入资产包名称" @keyup.enter.native="handleFilter"/>
        <el-button type="primary" icon="el-icon-search" @click="handleFilter">搜索</el-button>
        <el-button size="medium" type="info" @click="clearParams">清空</el-button>
        <el-radio-group v-model="radio" @change="handleFilter">
          <el-radio label="" border style="margin-left:36px;">全部</el-radio>
          <el-radio label="down" border>未上架</el-radio>
          <el-radio label="up" border>已上架</el-radio>
        </el-radio-group>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { classPackageBus } from './eventBus'
export default {
  data() {
    return {
      radio: '',
      search: ''
    }
  },
  methods: {
    handlePush() {
      this.$router.push('/classpackage/merchant-manage')
    },
    handleFilter() {
      classPackageBus.$emit('handleFilter', { search: this.search, status: this.radio })
    },
    clearParams() {
      this.search = ''
      this.radio = ''
      classPackageBus.$emit('handleFilter', { search: this.search, status: this.radio })
    }
  }
}
</script>

<style lang="scss" scoped>
.search {
  width: 100%;
  height: 70px;
  line-height: 70px;
  min-width:1003px;
  ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
}
</style>
